import java.util.Scanner;

public class test2 {
    //猴子选大王
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        boolean[] monkey = new boolean[n];
        int len = n;
        int i = 0;
        while(len!=1){
            int count = 2;
            while(count!=0){
                while(monkey[i]){
                    i = (i+1)%n;
                }
                    count--;
                i = (i+1)%n;
            }
            while(monkey[i]){
                i = (i+1)%n;
            }
            monkey[i] = true;
            System.out.print(i+" ");
            len--;
        }

        System.out.println();
        for(int j = 0;j<monkey.length;j++){
            if(!monkey[j]){
                System.out.println(j+1);
            }
        }
    }
}
